<template>
	<view>
		<uni-card :is-shadow="false">
			<view class="avatar text-center">头像</view>
			<uni-title type="h1" :title="user.name" align="center"></uni-title>
			<uni-title type="h3" :title="user.role.name" align="center"></uni-title>
		</uni-card>
		
		<uni-card :is-shadow="false" padding="10px 0">
			<uni-section title="今日的工作?" type="line"></uni-section>
			<uni-row class="text-center">
				<uni-col :span="8">
					<img src="https://project-1310548517.cos.ap-shanghai.myqcloud.com/app/schedules.png" alt="">
					<view>计划任务</view>
				</uni-col>
				<uni-col :span="8">
					<img src="https://project-1310548517.cos.ap-shanghai.myqcloud.com/app/quality.png" alt="">
					<view>质量管理</view>
				</uni-col>
				<uni-col :span="8">
					<img src="https://project-1310548517.cos.ap-shanghai.myqcloud.com/app/safe.png" alt="">
					<view>安全检查</view>
				</uni-col>
			</uni-row>
		</uni-card>
		
		<uni-card :is-shadow="false" padding="10px 0">
			<uni-section title="未来三天的工作?" type="line"></uni-section>
			<uni-row class="mt15">
				<uni-col :span="20">
					<view>计划任务(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>质量管理(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>安全检查(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
		</uni-card>
		
		<uni-card :is-shadow="false" padding="10px 0">
			<uni-section title="逾期的工作?" type="line"></uni-section>
			<uni-row class="mt15">
				<uni-col :span="20">
					<view>计划任务(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>质量管理(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>安全检查(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
		</uni-card>
		
		<uni-card :is-shadow="false" padding="10px 0">
			<uni-section title="维护工作?" type="line"></uni-section>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>质量管理(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>安全检查(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
		</uni-card>
		
		<uni-card :is-shadow="false" padding="10px 0">
			<uni-section title="审核工作?" type="line"></uni-section>
			<uni-row class="mt15">
				<uni-col :span="20">
					<view>计划任务(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>质量管理(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
			<uni-row  class="mt15">
				<uni-col :span="20">
					<view>安全检查(0/1)</view>
				</uni-col>
				<uni-col :span="4"><uni-tag text="查看" type="warning" /></uni-col>
			</uni-row>
		</uni-card>
	</view>
</template>

<script>
import request from '../../api/request'

	export default {
		data() {
			return {
				user:{
					name:'',
					role:{name:'',id:0},
					mobile:'',
				}
			}
		},
		onShow() {
			this.onGetData()
		},
		methods: {
			onGetData(){
				let _this = this
				request('user','POST',{}).then(res => {
					if(res.code != 200){
						uni.showToast({title: res.msg,icon: 'error',duration: 2000})
						return;
					}
					_this.user = res.data
				}).catch(err => {
					console.log(err)
				})
			}
		}
	}
</script>

<style>
.uni-row{padding: 0px 15px;}
</style>
